The present invention relates generally to digital audio amplifiers and more particularly to a method and apparatus for reducing harmonic distortion resulting from uniform pulse width modulation.
Digital audio amplifiers typically implement one of several pulse width modulation schemes to effect audio signal modulation. In these amplifiers, uniform pulse width modulation, hereinafter UPWM, is a standard method of pulse width modulation used in some known audio amplifiers wherein the amplitude of each input sample is converted to a corresponding output pulse width. The beginning and ending points of a pulse can be defined by points of intersection between a saw-tooth modulation waveform and a quantized input signal waveform. UPWM is easily implemented but is known to produce significant detrimental harmonic distortion resulting in a nonlinear response. The frequency spectrum of each pulse varies as a function of the pulse width. This dynamic variation is the cause of undesirable harmonic distortion.
Another method of modulating audio signals known as natural pulse width modulation, hereinafter NPWM, is inherently distortion free. The beginning and ending points of a pulse are defined by points of intersection between a saw-tooth modulating waveform and an analog input waveform. However, NPWM cannot be implemented in a quantized system with digital input because it operates on an analog input signal. Various techniques are known to approximate NPWM in fully digital systems and thereby reduce harmonic distortion.
Other methods are known that emulate NPWM by using linearizing algorithms which operate on information from more than one input sample to determine each output pulse width. Such methods are often referred to as linearized pulse width modulation, hereinafter LPWM. Prior art demonstrates linear interpolation between two adjacent input samples to achieve the output pulse width. For example, Mellor, P. H. et al, xe2x80x9cReduction of Spectral Distortion in Class D Amplifiers by Enhanced Pulse Width Modulation Sampling Processxe2x80x9d IEEE Proceedings-G, Vol. 138, No. 4, August 1991 pp. 441-448 teaches an enhanced sampling process wherein an analog input signal f(t) is transformed into an enhanced signal fn(t) where fn(t)=f((1xe2x88x92xcex5)(txe2x88x92nT)+nT) and 0xe2x89xa6xcex5xe2x89xa61 before it is combined with a saw-tooth modulation wave to define output pulse widths. T is the sampling period, n is the sample index and t is the independent variable. As variable xcex5 approaches 0, the interpolation approaches natural sampling. As xcex5 approaches 1, the interpolation approaches uniform sampling. Other interpolation methods are known using increasing numbers of samples to define each output pulse. Such methods more closely approach natural sampling but require more complex implementation.
Other methods of distortion reduction of UPWM in the prior art provide improvements by introducing several filters to correct for non-linearity. For example, Hawksford, M. O. J., xe2x80x9cDynamic Model Based Linearization of Quantized Pulse Width Modulation for Applications in Digital to Analog Conversion and Digital Power Amplifier Systemsxe2x80x9d Journal of Audio Engineering Society, Vol. 40, NO. 4, April 1992, pp. 235-250 teaches a method of compensating for the frequency dependant harmonic distortion over a limited bandwidth. Multiple finite impulse response (FIR) filters are interleaved between over-sampled pulse code modulated (PCM) data and a pulse width modulator wherein frequency responses are individually matched to the inverse square of each corresponding pulse in a pulse width modulated sequence. A dynamic filtering process is thereby provided. The extra filtering components used in these methods require an undesirably large number of storage elements and calculation cycles.
Still other methods of distortion reduction in pulse width modulated systems involve much additional complexity and require significant ROM storage. For example, Craven, Peter, xe2x80x9cToward the 24 bit DAC: Novel Noise-Shaping Topologies incorporating Correction for the Non-linearity in a PWM Output Stage.xe2x80x9d Journal Audio Engineering Society, Vol. 41, No. 5, May 1993, pp. 291-311 teaches a complex method of nonlinear noise shaping which digitally simulates the intrinsic non-linearity of a pulse width modulation system and provides corrections through feedback and feed-forward paths.
U.S. Pat. No. 5,617,058 to Adrian et al. which is incorporated herein by reference teaches implementation of techniques for ternary modulation wherein a compensating pulse is added to an output pulse to compensate the linearity of a power switch. The Adrian et al. patent also teaches signal flow for digital amplification.
All prior mentions of linear interpolation in digital pulse width modulation either do not include an algorithm to determine the pulse width, or they disadvantageously use a division operation to compute the pulse width. Division operations are extremely computationally inefficient in digital signal processing and require many more computation steps than addition or multiplication operations, for example. Additional silicon area is therefore required to implement techniques involving division. Generally known implementations do not provide computationally efficient methods to reduce harmonic distortion in pulse width modulated systems. None of the prior art methods completely eliminate harmonic distortion.
The present invention substantially reduces harmonic distortion in a pulse width modulated system by approximating natural pulse width modulation (NPWM) using a method of linear interpolation that requires only additions and multiplications of data in a manner which is computationally efficient for digital signal processing.
According to the invention, a linearization algorithm is implemented between an interpolation, such as may be performed using a finite impulse response filter, (FIR), and a noise shaper. The linearization algorithm iteratively estimates the intersection between a natural input and the modulation wave thereby significantly reducing certain harmonic distortion that is inherent in uniform pulse width modulation (UPWM).
The present invention implements a frequency detector algorithm which disables the linearization algorithm at high frequencies. The frequency detector in an exemplary embodiment consists of a state machine that selects either to implement or bypass the linearization algorithm. The frequency detection algorithm is performed once per input sample before the interpolation filter. Where ternary pulse width modulation is used, a limiting frequency is chosen at the sampling frequency divided by six because the third harmonic is the dominant distortion product of compensated ternary pulse width modulation. Where binary pulse width modulation is used, a limiting frequency is chosen at the sampling frequency divided by four because the second harmonic is the dominant distortion product for compensated binary pulse width modulation. Above these frequencies, the dominant distortion product will be above the audio frequency band.
The output of the linearization algorithm in the illustrative embodiment is input to the noise-shaper, which reduces the number of bits and thereby allows the PWM output clocking to run at an attainable speed. The noise shaper output is then encoded into ternary PWM timing information. The ternary PWM output comprises three states: positive, negative and damped. Each of these states is entered every PWM cycle. The values generated for the output timer are, compensation, pulse, delay and sign. These values are loaded into the counter and determine the length of time the output remains in each state for each PWM cycle. For binary pulse width modulation, the output of the noise shaper indicates the sole pulse value. The application of the linearization algorithm practically necessitates the use of single-sided modulation because using double sided modulation with linearized pulse width modulation severely increases the complexity of the noise shaper. A standard noise shaper, known in prior art, may be used in conjunction with single sided modulation.
Linearized pulse width modulation (LPWM) can also be applied to binary modulation. Binary modulation comprises only two output states: positive and negative. The net pulse output is the difference between the time spent in each state per pulse period. All of the benefits of the present invention may be applied to binary pulse width modulation systems by implementing an alternative embodiment having a modified linearization algorithm.
It has been determined that the combined use of interpolation and linearized pulse width modulation introduces certain additional distortion that has not been discussed in the prior art. It has long been known that the over-sampled signal output from the interpolation filter contains spectral images replicated around multiples of the original sampling frequency. These images are attenuated by the interpolation filter. Because Nyquist theorem is obeyed in the encoding of the digital signal, these images never reach back into the audio spectrum and therefore do not cause audible distortion. However, where a linearization algorithm is applied to data post interpolation filter, it has been found that compensation products of the linearization algorithm can intermodulate with the replicated spectral images of the FIR filter and, at high frequencies, cause distortion to appear back in the audio spectrum.
Pulse width modulation encoding of a signal is also known to produce distortion products. However these known distortion products do not intermodulate with replicated spectral images because conversion to pulse width modulation does not follow Nyquist""s theory. The significant distortion products caused by pulse width modulation are out of band at high frequencies so any benefit gained by application of linearization processing at high frequencies may be outweighed by detrimental intermodulation distortion.
Features of the present invention include a method of significantly reducing the harmonic distortion that is typically associated with uniform pulse width modulation (UPWM). As an additional feature, the present invention is implemented on a quantized digital system, unachievable in natural pulse width modulation (NPWM) systems. The present invention also includes the benefits of linearized pulse width modulation (LPWM) using a significantly simplified implementation. The implementation according to the invention features an algorithm which does not require division operations and therefore advantageously requires fewer storage elements and computation cycles than other distortion reduction methods. By requiring fewer storage elements and computation cycles, the invention facilitates fast operation and minimum physical space on an integrated circuit. As a result, the invention features a low cost, highly efficient method of reducing harmonic distortion in a digital pulse width modulated system.
Certain implementations of the present invention provide additional advantages of having a lower noise floor and lower distortion for damped ternary modulation at high amplitudes when a compensation pulse is not used.